import { _decorator, Component, Node } from 'cc';
import Logger, { lerror, llog, LOG_LEVEL, lwarn } from '../../sgame/logger/Logger';
const { ccclass, property } = _decorator;

@ccclass('Main')
export class Main extends Component {
    start() {
        Logger.Init(true, LOG_LEVEL.LOG);
        this.testLog()

        Logger.LogLevel(LOG_LEVEL.WARN);
        console.log("Logger.LogLevel(LOG_LEVEL.WARN)");
        this.testLog()

        console.log("关闭日志");
        Logger.Enable(false);
        this.testLog();
    }

    private testLog() {
        llog("日志开启", true, "日志等级", LOG_LEVEL.LOG, "基础日志");
        lwarn("日志开启", true, "日志等级", LOG_LEVEL.LOG, "警告日志");
        lerror("日志开启", true, "日志等级", LOG_LEVEL.LOG, "错误日志");
    }
}

